<%@page import="java.text.SimpleDateFormat"%>
<%@page import="Entity.IDoc"%>
<%@page import="DataAccess.IDocAccess"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../js/jquery-1.5.1.js"></script>
        <script type="text/javascript" src="../js/jquery.ui.core.js"></script>
        <script type="text/javascript" src="../js/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="../js/wyzz.js"></script>
        <style type="text/css">
            @import "../css/main.css";
            @import "../css/menu.css";
            @import "../css/wyzzstyles/style.css";
            @import "../css/wyzzstyles/editarea.css";
            @import "../menu/menu_style.css";
            @import "../css/VanBanDen.css";
            @import "../css/jquery.ui.datepicker.css";
            @import "../css/jquery.ui.theme.css";
            .ui-widget{font-size:0.7em;}
            .ui-helper-hidden-accessible{clip:auto;}
        </style>
        <script>
            $(function() {
                    $( ".datepicker" ).datepicker();
            });

	</script>

        <title>JSP Page</title>
    </head>
    <body>
        <%@include file="../header.jsp" %>
        <%
            Long ID = Long.parseLong(request.getParameter("ID"));
            IDocAccess idoc = new IDocAccess();
            IDoc entity = new IDoc();
            entity = idoc.getIDocByID(ID);
            SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        %>
    <div id="vbd">
    Sửa thông tin văn bản đến
    </div>
    <div id="vanbanden">
    	<form name="form1" action="/idoc" method="post" id="form1">
            <input type="hidden" name="action" value="edit"/>
            <input type="hidden" name="txtID" value="<% out.print(entity.getIDocID()); %>"/>
                <table width="930" height="491" border="0" align="center" id="table">
                <tbody>
                <tr>
                  <td width="129" height="32">Số văn bản đến</td>
                  <td width="175"><input type="text" name="txtPubNum" id="txtSoVBDen" value="<% out.print(entity.getPubNum()); %>"></td>
                  <td width="119">Số ghi sổ</td>
                  <td width="173"><input type="text" name="txtReceiveNum" id="txtSoGhiSo" value="<% out.print(entity.getReceiveNum()); %>" ></td>
                  <td width="128">Ngày đến</td>
                  <td width="180">
                  <input id="datepicker" name="txtReceiveDate" type="text" value="<% out.print(df.format(entity.getReceiveDate())); %>" ></td>
                </tr>
                <tr>
                  <td height="29">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>Trả lời VB số</td>
                  <td><input type="text" name="txtODocID" id="txtTraLoiVBSo" value="<% out.print(entity.getODocID()); %>" ></td>
                  <td>Ngày phát hành</td>
                  <td><input id="datepicker" name="txtPubDate" type="text" value="<% out.print(df.format(entity.getReceiveDate())); %>" ></td>
                </tr>
                <tr>
                  <td height="68">Tựa đề</td>
                  <td colspan="5">
                      <input type="text" name="txtSubject" id="multilineTuaDe" value="<% out.print(entity.getSubject()); %>"/>
                  </td>
                </tr>
                <tr>
                  <td height="123">Nội dung tóm tắt</td>
                  <td colspan="5"><textarea name="txtBriefContent" id="test2">
                     <% out.print(entity.getBriefContent()); %>
                  </textarea>
                   <script language="javascript1.2" >
                        make_wyzz('test2');
                   </script>
                  </td>
                </tr>
                <tr>
                  <td height="120">Ghi chú</td>
                  <td colspan="5"><textarea name="txtNotes" id="test1">
                         <% out.print(entity.getNotes()); %>
                      </textarea>
                   <script language="javascript1.2" >
                        make_wyzz('test1');
                   </script>

                  </td>
                </tr>
                <tr>
                  <td height="31">Người ký</td>
                  <td colspan="2"><input type="text" name="txtSignByName" id="txtNguoiKy" value="<% out.print(entity.getSignByName()); %>"></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="34">&nbsp;</td>
                <td><label>
                        <input type="radio" name="rdClosed" id="radDaXuLy" checked="<% if(entity.getClosed() == true) out.print("true"); else out.print("false"); %>" value="true">
                  Đã xử lý</label></td>
                  <td colspan="2"><label>
                          <input type="radio" name="rdClosed" id="radChuaXuLy" value="false" checked="<% if(entity.getClosed() == true) out.print("false"); else out.print("true"); %>" >
                  Chưa xử lý</label></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="36">
                      <input type="submit" name="btnSave" id="button" value="Lưu"></td>
                  <td>
                      <input type="button" name="btnTroVe" id="button" value="Trở về" ONCLICK="history.go(-1)"></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                </tbody>
              </table>
      </form>
    </div>
    </body>
</html>
